package com.haiheng.library_base.utils

import android.content.Context
import android.content.res.Configuration

/**
 *
 * @Des:
 * @Author: hwz
 * @Date:2022/4/15 0015
 * @Version: 1.0
 */
object UIModeUtils {

    fun Context.isNightMode(): Boolean {
        val config = resources.configuration
        val uiMode = config.uiMode and Configuration.UI_MODE_NIGHT_MASK
        return uiMode == Configuration.UI_MODE_NIGHT_YES
    }

}